﻿<%@ Page Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="Users.aspx.cs"
    Inherits="Secured_Users" Title="Users Registered" %>

<%@ MasterType VirtualPath="~/Layout.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder1" runat="Server">
    <div style="font-size: large">
        Users' Registered
    </div>
    <br />
    <div>
        <asp:Literal ID="ltMsg" runat="server" />
    </div>
    <br />
    <div>
        <asp:GridView ID="grdUsers" runat="server" AutoGenerateColumns="False" DataKeyNames="UserID,UserName,DOB,EmailAddr,SecretQuestion,LastLogin,isApproved"
            EnableModelValidation="True" 
            OnRowCancelingEdit="grdUsers_RowCancelingEdit" OnRowEditing="grdUsers_RowEditing"
            OnRowUpdating="grdUsers_RowUpdating" OnRowDeleting="grdUsers_RowDeleting" OnSelectedIndexChanging="grdUsers_SelectedIndexChanging"
            GridLines="None" CellPadding="3">
            <HeaderStyle Width="100px" HorizontalAlign="Left" Wrap="False" />
            <Columns>
                <asp:BoundField HeaderText="UserID" DataField="UserID" Visible="false" />
                <asp:BoundField HeaderText="UserName" DataField="UserName" ReadOnly="true" />
                <asp:BoundField HeaderText="Date of Birth" DataField="DOB" ReadOnly="true" DataFormatString="{0:MMM dd, yyyy}" />
                <asp:BoundField HeaderText="E-Mail Address" DataField="EMailAddr" ReadOnly="true" />
                <asp:BoundField HeaderText="Secret Question" DataField="SecretQuestion" ReadOnly="true" />
                <asp:BoundField HeaderText="Last Login" DataField="LastLogin" ReadOnly="true" />
                <asp:TemplateField HeaderText="Approved">
                    <ItemTemplate>
                        <%# Eval("IsApproved") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:CheckBox ID="chkIsApproved" runat="server" Checked='<%# Eval("isApproved") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ButtonType="Button" InsertVisible="False" SelectText="..." 
                    ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
